package org.seven.cpcrkapp.activity;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.EditText;

import org.seven.cpcrkapp.R;
import org.seven.cpcrkapp.util.CacheUtils;
import org.seven.cpcrkapp.util.DateUtils;
import org.seven.cpcrkapp.util.DialogUtils;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class InActivity extends AppCompatActivity {
    @BindView(R.id.toolbar_in)
    Toolbar toolbar;
    @BindView(R.id.v_sfbj)
    EditText v_sfbj;
    @BindView(R.id.v_scrq)
    EditText v_scrq;

    private String[] list_sfbj = CacheUtils.getList(CacheUtils.DICT_PH);

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_in);
        ButterKnife.bind(this);
        setSupportActionBar(toolbar);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        v_scrq.setText(DateUtils.getString());
    }

    @OnClick(R.id.v_sfbj)
    public void OnClickVsfbj(View view) {
        DialogUtils.showItemsDialog(InActivity.this, list_sfbj, (EditText) view);
    }

    @OnClick(R.id.v_scrq)
    public void OnClickVscrq(View view) {
        DialogUtils.showDateDialog(InActivity.this, (EditText) view);
    }
}
